﻿#include "SolutionEntity.h"
#include <QJsonDocument>
#include <QUuid>
#include <SqliteDatabase.h>
SolutionEntity::SolutionEntity():
    mId(QUuid::createUuid().toString())
  ,mName("default")
{

}

QVariant SolutionEntity::toVariant() const
{
    QVariantMap map;
    map.insert("id",mId);
    map.insert("name", mName);
    map.insert("data", mData);
    return map;
}

void SolutionEntity::fromVariant(const QVariant &variant)
{
    QVariantMap map = variant.toMap();
    mId = map.value("id").toString();
    mName = map.value("name").toString();
    mData = map.value("data").toJsonObject();
}
